home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 414_02 / portable / waddstr.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-17  |  1.6 KB  |  62 lines

  1. #define    CURSES_LIBRARY    1
  2. #include <curses.h>
  3. #undef    waddstr
  4.  
  5. #ifdef PDCDEBUG
  6. char *rcsid_waddstr = "$Header: C:\CURSES\portable\RCS\waddstr.c 2.1 1993/06/18 20:21:28 MH Rel MH $";
  7. #endif
  8.  
  9.  
  10.  
  11.  
  12. /*man-start*********************************************************************
  13.  
  14.   waddstr()    - add string to window
  15.  
  16.   X/Open Description:
  17.      These routines write all the characters of the null-terminated
  18.      string str on the given window.  The functionality is equivalent
  19.      to calling waddch() once for each character in the string.
  20.  
  21.      NOTE:  addstr(), mvaddstr(), and mvwaddstr() are macros.
  22.  
  23.   PDCurses Description:
  24.      The *raw*() routines output 8 bit values.  These contrast to their
  25.      normal counterparts which output 7 bit values and convert control
  26.      character to the ^X notation.
  27.  
  28.      str is a standard 8 bit character string WITHOUT embedded attributes.
  29.  
  30.   X/Open Return Value:
  31.      The waddstr() function returns OK on success and ERR on error.
  32.  
  33.   PDCurses Errors:
  34.      It is an error to call this function with a NULL window pointer.
  35.  
  36.   Portability:
  37.      PDCurses    int waddstr( WINDOW* win, char* str );
  38.      X/Open Dec '88    int waddstr( WINDOW* win, char* str );
  39.      BSD Curses    int waddstr( WINDOW* win, char* str );
  40.      SYS V Curses    int waddstr( WINDOW* win, char* str );
  41.  
  42. **man-end**********************************************************************/
  43.  
  44. int    waddstr(WINDOW *win, char *str)
  45. {
  46. #ifdef PDCDEBUG
  47.     if (trace_on) PDC_debug("waddtsr() - called: string=\"%s\"\n",str);
  48. #endif
  49.  
  50.     if (win == (WINDOW *)NULL)
  51.         return( ERR );
  52.  
  53.     while (*str)
  54.     {
  55.         if (waddch(win, *str++) == ERR)
  56.         {
  57.             return( ERR );
  58.         }
  59.     }
  60.     return( OK );
  61. }
  62.